<%@ page language="java" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<%@ include file="/pub/head_latest.inc"%>
    	<title>数据明细</title>
	</head>
	<body>
  		 <form id="mainform" method="post"></form>
  		 <script>
  		var mainform = $("#mainform");
  		var fields = [];
  		 <c:forEach var="o" items="${drawForm.results}" varStatus="idx">
   			var field_${idx.index}= {};
		   		field_${idx.index}.display = '${o.displayName}';
		   		field_${idx.index}.name = '${o.fieldName}';
		   		field_${idx.index}.readonly = true;
		   		fields[${idx.index}] = field_${idx.index};
   		</c:forEach>
        mainform.ligerForm({ 
            fields: fields,
            toJSON: JSON2.stringify
        });
  		 </script>
  		 <script>
  		 
  		 function FF_AfterLoaded(data){
  			 
  		 }
  		 var params = "";
  		 <c:forEach var="o" items="${drawForm.views}" varStatus="idx">
  		 	<c:if test="${o.value != null}">
  		 		params += "&${o.displayFieldName}=${o.value}";
  		 	</c:if>
      	</c:forEach>
     
  		 LG.loadForm({mainForm: mainform, 
  	    	  url:'${baseURL}/report/reportview/detailJSON.do?csId=${drawForm.id}'+params,callback: FF_AfterLoaded});

  		 </script>
   		 <!-- 报表打印区域 start -->
  		<iframe id="exportFrame" style="display:none" name="exportFrame" src="${baseURL}/report/reportview/defaultReport.do?csId=${drawForm.id}&rand=Math.rand()"></iframe>
  	<!-- 	 <script>
			function FF_Print(){
				var json = {};
  				exportFrame.window.FF_Print(json);
 			}
			
			function FF_ExportExcel(){
				var json = {};
 				exportFrame.window.FF_ExportExcel(json);
 			}
			
			function FF_ExportDoc(){
				var json = {};
 				exportFrame.window.FF_ExportDoc(json);
			}
			
			function FF_ExportPDF(){
				var json = LG.bulidFilterParams($("#formsearch"));
				exportFrame.window.FF_ExportPDF(json);
			}
			
			 var buttons = [];
			 <c:if test="${drawForm.print}">
             	buttons.push({ text: '打印', onclick: FF_Print });
	         </c:if>
	         <c:if test="${drawForm.pdf}">
          		buttons.push({ text: '导出pdf', onclick: FF_ExportPDF });
	         </c:if>
	         <c:if test="${drawForm.doc}">
       			buttons.push({ text:'导出word', onclick: FF_ExportDoc });
	         </c:if>
	         <c:if test="${drawForm.excel}">
    			buttons.push({ text: '导出excel', onclick: FF_ExportExcel });
	         </c:if>
 	          if(buttons.length > 0)
	         	LG.addFormButtons(buttons);
		</script> -->
		<!-- 报表打印区域 end -->
 	</body>
</html>
